package com.example.myapplicationndk.mvp;

import java.io.Serializable;


/**
 *网络请求响应基本泛型
 *Author     Vin
 *Mail       vinintg@gmail.com
 *Createtime 2019/3/18 上午9:50
 *Modifytime 2019/3/18 上午9:50
 */
public class BaseResponseDto<T> implements Serializable {

    private static final long serialVersionUID = -71404059144317707L;
    private Integer status;//状态码 0正常,其他都不正常
    private String message;//返回信息
    private T data;//返回信息实体

    public Integer getStatus() {
        return status;
    }

    public void setStatus(Integer status) {
        this.status = status;
    }

    public String getMessage() {
        return message;
    }

    public void setMessage(String message) {
        this.message = message;
    }

    public T getData() {
        return data;
    }

    public void setData(T data) {
        this.data = data;
    }

    @Override
    public String toString() {
        final StringBuilder sb = new StringBuilder("{");
        sb.append("\"status\":")
                .append(status);
        sb.append(",\"message\":\"")
                .append(message).append('\"');
        sb.append(",\"data\":")
                .append(data);
        sb.append('}');
        return sb.toString();
    }
}
